<template>
  <div>
    <el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Titile">
      <el-row :gutter="5">
        <el-form ref="elForm" :model="generatorConfig" :rules="rules" size="small" label-width="100px"
                 label-position="left">

        </el-form>
      </el-row>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handelConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  inheritAttrs: false,
  components: {},
  props: [],
  data() {
    return {
      generatorConfig: {
        type: "",
        multiple: "false",
        disabled: "false",
        filterable: "false",
        placeholder: "请选择",
      },
      rules: {
        type: [{
          required: true,
          message: '请选择下拉选择字典类别',
          trigger: 'change'
        }],
        multiple: [{
          required: true,
          message: '是否多选不能为空',
          trigger: 'change'
        }],
        disabled: [{
          required: true,
          message: '是否禁用不能为空',
          trigger: 'change'
        }],
        filterable: [{
          required: true,
          message: '可搜索不能为空',
          trigger: 'change'
        }],
        placeholder: [{
          required: true,
          message: '请输入提示内容',
          trigger: 'blur'
        }],
      },
      typeOptions: [{
        "label": "selelct",
        "value": "selelct"
      }],
      multipleOptions: [{
        "label": "开启",
        "value": "true"
      }, {
        "label": "关闭",
        "value": "false"
      }],
      disabledOptions: [{
        "label": "禁用",
        "value": "true"
      }, {
        "label": "不禁用",
        "value": "false"
      }],
      filterableOptions: [{
        "label": "开启",
        "value": "true"
      }, {
        "label": "关闭",
        "value": "false"
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    onOpen() {},
    onClose() {
      this.$refs['elForm'].resetFields()
    },
    close() {
      this.$emit('update:visible', false)
    },
    handelConfirm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        this.close()
      })
    },
  }
}

</script>
<style>
</style>
